import request from '@/utils/request'

// 登陆/注册
export const login = (data) => {
  return request({
    method: 'POST',
    url: '/user/login',
    data
  })
}

// 获取当前用户信息
export const getUserInfo = () => {
  return request({
    method: 'GET',
    url: '/user'
  })
}

// 获取用户频道列表
export const getUserChannels = () => {
  return request({
    method: 'GET',
    url: '/user/channels'
  })
}

// 更新用户信息
export const setUserInfo = (data) => {
  return request({
    method: 'PATCH',
    url: '/user/usersInfo',
    data
  })
}

// 更新用户头像
export const setUserAvatar = (data) => {
  return request({
    method: 'PATCH',
    url: '/user/avatar',
    data
  })
}
